/*
 * @Author: Oscar Pena
 * CS431 2011
 * Beepers can be placed at any location in the terrain and they can be collected or dropped by the Finch
 * */
package FlowGram.Application.SimulatorWindow.TerrainEditor;

import java.awt.Color;
import java.awt.Graphics2D;

public class Beeper extends MapObject{
	private Color color;
	
	public Beeper(int x, int y){
		super.setPosition(x, y);		
		color = Color.BLACK;
	}
	public Beeper(int x, int y, Color c){
		super.setPosition(x, y);
		color = c;
	}
	public Color getColor(){
		//@Description: returns the color of the beeper
		//@Assumes: Beeper has color;
		return this.color;
	}
	public void setColor(Color c){
		//@Description: set Color of the beeper
		this.color = c;
	}
	public boolean equals(Beeper b){
		//Description: returns if a beeper is equal to another beeper Object
		return super.equals(b) && b.getColor() == this.color;
	}
	public String toString(){
		//@Desccription: returns the beeper members as an string
		String ts = "";
		ts = "Beeper " + super.toString() + " Color = " + this.color;
		return ts;
	}
	public void Draw(Graphics2D g2d, int scale){
		int x = this.getPositionX()*scale;
		int y = this.getPositionY()*scale;
		x = x + scale/2;
		y = y + scale/2;
		int x1 = x - scale/3;
		int y1 = y;
		int x2 = x;
		int y2 = y - scale/3;
		g2d.setColor(this.getColor());
		for (int i=0;i<scale/3;i++){
			
			g2d.drawLine(x1, y1, x2, y2);
			x1++;
			y1++;
			x2++;
			y2++;
		}
		
		
	}
	

}
